package senpec.qc.harmony.base.mybatisplus;

import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public interface IBaseController<T> {

    @GetMapping("/getById/{id}")
    default Result<T> getById(@PathVariable("id") Long id) {
        return Result.error();
    }

    @GetMapping("/getOneByCondition/{columnName}/{columnValue}")
    default Result<T> getOneByCondition(@PathVariable("columnName") String columnName, @PathVariable("columnValue") Object columnValue) {
        return Result.error();
    }

    @GetMapping("/getListByCondition/{columnName}/{columnValue}")
    default Result<List<T>> getListByCondition(@PathVariable("columnName") String columnName, @PathVariable("columnValue") Object columnValue) {
        return Result.error();
    }

    @PostMapping("/getOneByConditions")
    default Result<T> getOneByConditions(T conditions) {
        return Result.error();
    }

    @PostMapping("/getListByConditions")
    default Result<List<T>> getListByConditions(T conditions) {
        return Result.error();
    }

    @PostMapping
    default Result<T> insertOne(T entity) {
        return Result.error();
    }

    @PutMapping
    default Result<T> updateOne(T entity) {
        return Result.error();
    }

    @DeleteMapping("/physical/{id}")
    default Result<?> physicalDeleteById(@PathVariable("id") Long id) {
        return Result.error();
    }

    @DeleteMapping("/logical/{id}")
    default Result<?> logicalDeleteById(@PathVariable("id") Long id) {
        return Result.error();
    }

    @GetMapping("/active/{id}")
    default Result<?> activeById(@PathVariable("id") Long id) {
        return Result.error();
    }

    @GetMapping("/tree")
    default Result<List<T>> getTree() {
        return Result.error();
    }

}
